\documentclass[tikz,border=2mm]{standalone}
\usepackage{array,amsmath,mathptmx,xcolor,bbding,pifont,colortbl}
\usepackage[UTF8]{ctex}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% 只需要这个就可以
\usepackage[thicklines]{cancel}
% 可以设置线条颜色，默认是黑色
\usepackage{xcolor}
\usepackage{tikz-cd}
\usepackage{tikz,graphicx,subfig,caption} % Required for drawing custom shapes
\usetikzlibrary{fit,matrix,chains,arrows,shapes,positioning,arrows.meta,chains,shadows,shapes.callouts,decorations.text,shapes.symbols,shapes.misc, positioning,decorations.pathreplacing,calc,backgrounds,}

% 额外添加
\usepackage{indentfirst}
\usepackage{diagbox}
\usepackage{amssymb}
\usepackage{pifont}

\begin{document} 
	\begin{tikzpicture}[>=latex,every node/.style={anchor=south west,,inner sep=0,fill=white}]
		
		\node(s_enter)[draw, rounded rectangle, anchor=west,align=left,fill=white,inner sep=0.3em] at (0,0){入口}; 
		\node(s_F)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]s_enter.south){\qquad F\quad}; 
		\draw[-] ([xshift=-1.2em,yshift=0em]s_F.north) -- ([xshift=-1.2em,yshift=0em]s_F.south);
		\node(s_select1)[draw, diamond,aspect=2, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.8em]s_F.south){ $*$ }; 
		\node(s_select2)[draw, diamond,aspect=2, anchor=west,align=left,fill=white,inner sep=0.3em] at ([xshift=2em,yshift=0em]s_select1.east){ $/$ }; 
		\node(s_next1)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]s_select1.south){NEXT(w)}; 
		\node(s_next2)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.0em]s_select2.south){NEXT(w)};
		\node(s_F1)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]s_next1.south){\qquad F\quad};
		\draw[-] ([xshift=-1.2em,yshift=0em]s_F1.north) -- ([xshift=-1.2em,yshift=0em]s_F1.south);
		\node(s_F2)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]s_next2.south){\qquad F\quad};
		\draw[-] ([xshift=-1.2em,yshift=0em]s_F2.north) -- ([xshift=-1.2em,yshift=0em]s_F2.south);
		\node(s_geq1)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.5em]s_F1.south){ GEQ($*$) }; 
		\node(s_geq2)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.5em]s_F2.south){ GEQ($/$) }; 
		\node(s_exit)[draw, rounded rectangle, anchor=west,align=left,fill=white,inner sep=0.3em] at ([xshift=1em,yshift=-2.7em]s_geq2.east){出口}; 
		\node(blank)[anchor=west,align=left,fill=white,inner sep=0.3em] at ([xshift=-2em,yshift=0em]s_F1.west){\ };
		
		\draw[->] (s_enter.south) -- (s_F.north);
		\draw[->] (s_F.south) -- (s_select1.north);
		\draw[->] (s_select1.south) -- (s_next1.north);
		\draw[->] (s_select2.south) -- (s_next2.north);
		\draw[->] (s_select1.east) -- (s_select2.west);
		\draw[->] (s_select2.east) -| (s_exit.north);
		\draw[->] (s_next1.south) -- (s_F1.north);
		\draw[->] (s_next2.south) -- (s_F2.north);
		\draw[->] (s_F1.south) -- (s_geq1.north);
		\draw[->] (s_F2.south) -- (s_geq2.north);
		\draw[-] (s_geq1.south) |- ([xshift=-1em,yshift=-1.5em]s_geq1.west);
		\draw[-] (s_geq2.south) |- ([xshift=-1em,yshift=-1.5em]s_geq1.west);
		\draw[->] ([xshift=-1em,yshift=-1.5em]s_geq1.west) |- ([xshift=0em,yshift=-0.5em]s_F.south);
		
		\node(s_R4)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=-0.6em]s_F.south){\textcolor{blue}{R4}}; 
		\node(s_R5)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=-0.6em]s_F1.south){\textcolor{blue}{R5}}; 
		\node(s_R6)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=-0.6em]s_F2.south){\textcolor{blue}{R6}}; 
		\node(s_y1)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=-0.3em]s_select1.south){y};
		\node(s_n1)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=3em,yshift=0.1em]s_select1.north){n};
		\node(s_y2)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=-0.3em]s_select2.south){y};
		\node(s_n2)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=3em,yshift=0.1em]s_select2.north){n};
		
		\node(note1)[draw, rectangle callout,callout relative pointer={(-0.3,-0.2)},rounded corners,align=center,inner sep=0.3em] at ([xshift=3em,yshift=-1em]s_enter.east){ 子程序\ T };
		
		\begin{pgfonlayer}{background}
			\node [draw, draw=black, fill=white,fit=(s_enter)(s_F)(s_select1)(s_select2)(s_next1)(s_next2)(s_F1)(s_F2)(s_geq1)(s_geq2)(s_exit)(blank),inner sep=0.5em] {};
		\end{pgfonlayer}
		
		\node(f_enter)[draw, rounded rectangle, anchor=west,align=left,fill=white,inner sep=0.3em] at ([xshift=13.5em,yshift=0em]s_enter.east){入口}; 
		\node(f_select1)[draw, diamond,aspect=2, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.8em]f_enter.south){ $i$ }; 
		\node(f_select2)[draw, diamond,aspect=2, anchor=west,align=left,fill=white,inner sep=0.3em] at ([xshift=2em,yshift=0em]f_select1.east){ $($ }; 
		\node(f_push)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.8em]f_select1.south){ PUSH(i) }; 
		\node(f_next1)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-3.8em]f_push.south){ NEXT(w) }; 
		\node(f_next2)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.7em]f_select2.south){ NEXT(w) };
		\node(f_E)[draw, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.8em]f_next2.south){\qquad E\quad}; 
		\draw[-] ([xshift=-1.2em,yshift=0em]f_E.north) -- ([xshift=-1.2em,yshift=0em]f_E.south);
		\node(f_exit)[draw, rounded rectangle, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-3.2em]f_next1.south){出口};
		\node(f_select3)[draw, diamond,aspect=2, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.8em]f_E.south){ $)$ }; 
		\node(f_err1)[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1.3em,yshift=-0.8em]f_select2.east){err1}; 
		\node(f_err2)[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1.3em,yshift=-0.8em]f_select3.east){err2}; 
		
		\draw[->] (f_enter.south) -- (f_select1.north);
		\draw[->] (f_select1.south) -- (f_push.north);
		\draw[->] (f_select1.east) -- (f_select2.west);
		\draw[->] (f_select2.south) -- (f_next2.north);
		\draw[->] (f_push.south) -- (f_next1.north);
		\draw[->] (f_next2.south) -- (f_E.north);
		\draw[->] (f_next1.south) -- (f_exit.north);
		\draw[->] (f_E.south) -- (f_select3.north);
		\draw[-] (f_select3.south) -- ([xshift=0em,yshift=-1em]f_select3.south);
		\draw[-] ([xshift=0em,yshift=-1em]f_select3.south) -| ([xshift=-1em,yshift=0em]f_select3.west);
		\draw[->] ([xshift=-1em,yshift=0em]f_select3.west) |- ([xshift=0em,yshift=-1.8em]f_push.south);
		\draw[->] (f_select2.east) |- ([xshift=2em,yshift=0em]f_select2.east);
		\draw[->] (f_select3.east) |- ([xshift=2em,yshift=0em]f_select3.east);
		
		\node(f_R7)[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1em,yshift=-0.6em]f_E.south){\textcolor{blue}{R7}}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1em,yshift=-0.3em]f_select1.south){y}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1em,yshift=-0.3em]f_select2.south){y}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=1em,yshift=-0.3em]f_select3.south){y}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=0.3em,yshift=0.8em]f_select1.east){n}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=0.3em,yshift=0.8em]f_select2.east){n}; 
		\node[anchor=north,align=left,fill=white,inner sep=0em] at ([xshift=0.3em,yshift=0.8em]f_select3.east){n}; 
		
		\begin{pgfonlayer}{background}
			\node [draw, draw=black, fill=white,fit=(f_enter)(f_select1)(f_select2)(f_select3)(f_push)(f_err1)(f_err2)(f_exit),inner sep=0.5em] {};
		\end{pgfonlayer}
		
		\node(note2)[draw, rectangle callout,callout relative pointer={(-0.3,-0.2)},rounded corners,align=center,inner sep=0.3em] at ([xshift=3em,yshift=-1em]f_enter.east){ 子程序\ F};
		
		\node(note)[draw, anchor=east,align=left,fill=yellow!20,inner sep=0.3em] at ([xshift=-5.5em,yshift=0em]s_exit.west){\textcolor{blue}{Ri}\ 返回地址}; 
		
	\end{tikzpicture}
\end{document}
